﻿using SuperMap.UI;
using System;
using System.Collections.Generic;
using System.Windows.Forms;

namespace Ycjw.PipeLine.Map.Basic.SuperMap
{
    /// <summary>
    /// 为统一管理场景操作状态设置的基类
    /// </summary>
    public abstract class  SceneOperInterface
    {
        protected Form m_FormMain;
        protected SceneControl m_SceneControl;
        public static Dictionary<string,SceneOperInterface> AllSceneOperInterface = new Dictionary<string, SceneOperInterface>();
        public static void Remove(Type t)
        {
            if (AllSceneOperInterface.ContainsKey(t.FullName))
            {
                AllSceneOperInterface.Remove(t.FullName);
            }
        }
        protected bool m_UnRegistered;
        public virtual bool UnRegistered { get => m_UnRegistered; set => m_UnRegistered = value; }
        public SceneOperInterface(SceneControl sceneControl, Form formMain) 
        {
            AllSceneOperInterface.Add(this.GetType().FullName,this);
            m_SceneControl = sceneControl;
            m_FormMain = formMain;
        }
        /// <summary>
        /// 取消注册
        /// </summary>
        public virtual void UnRegister() { }
    }
}
